package org.nokatag.system;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class NokaContext implements Serializable {

	private static final long serialVersionUID = -2301625754135917248L;
	private static final ThreadLocal<NokaContext> nokaContext = new ThreadLocal<NokaContext>();
	
    private Map<String, Object> context=new HashMap<String,Object>();
    public NokaContext(Map<String, Object> context) {
        this.context = context;
    }
    public static void setContext(NokaContext context) {
    	nokaContext.set(context);
    }
    public static NokaContext getContext() {
        return nokaContext.get();
    }
    public void setContextMap(Map<String, Object> contextMap) {
        getContext().context = contextMap;
    }
    public Map<String, Object> getContextMap() {
        return context;
    }
    public Object get(String key) {
        return context.get(key);
    }
    public void put(String key, Object value) {
        context.put(key, value);
    }
}
